let line = 13;
let res = 0;
let i = line;
while (i > 0) {
  if (Number.isInteger(Math.sqrt(i))) {
    let t = i;
    i = line - i;
    line = line - t;
    console.log(i);
    res++;
  } else {
    i--;
  }
}
console.log(res);
